﻿using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using scheduleMVC.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using scheduleMVC.DAL;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web.Mvc;
using scheduleMVC.Models;
using scheduleMVC.DAL;
using AppLimit.CloudComputing.SharpBox;
using AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox;
using System.IO;
using Microsoft.Live;
using System.Web.Security;
using Microsoft.AspNet.Identity;


namespace scheduleMVC.Controllers
{
    public class HomeController : Controller
    {


        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Albert T. Kim, CPA, PA is located in Catonsville, MD, just minutes from I695 & I70.  We are a full service accounting firm specializing in small to medium sized businesses.  If you need assistance with your accounting or bookkeeping, please contact us for a consultation.";
            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Albert T. Kim, CPA, PA";

            return View();
        }
        public ActionResult SystemIndex()
        {
            return View();
        }

        public ActionResult Customer()
        {

            TasksContext db = new TasksContext();
            FileContext dbF = new DAL.FileContext();
        
            string currentuserID = User.Identity.GetUserId().ToString();
            ViewBag.tasks = db.Tasks.Include(t => t.Customer).Where(a =>  a.Customer.UserId == currentuserID).Count();
            ViewBag.files = dbF.Files.Include(t => t.Customer).Where(a => a.Customer.UserId == currentuserID).Count();

            return View();
        }
    }
}